Skip to content

feat: add agent-friendly test output commands#75

Merged
clavery merged 1 commit intomainfrom
feat/agent-friendly-test-output
Jan 26, 2026
Merged

feat: add agent-friendly test output commands#75
clavery merged 1 commit intomainfrom
feat/agent-friendly-test-output

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented Jan 25, 2026

Summary

Closes #72

Adds agent-friendly command variants with minimal, machine-readable output optimized for AI coding agents. This reduces context token usage and makes it easier to identify actual failures.

New Commands

Command Description
pnpm run test:agent Run tests with minimal output (only failures + pass/fail summary)
pnpm run lint:agent Run linter with quiet mode (only errors shown)
pnpm run typecheck:agent Run type-check with single-line error format

Key Changes

Test Output Silencing:

  • Added runSilent() helper using oclif's captureOutput to suppress stdout/stderr from command execution
  • Updated stubParse helpers to set 'log-level': 'silent' by default
  • Added global test setup (test/setup.ts) to set SFCC_LOG_LEVEL=silent
  • Updated non-JSON mode tests to use runSilent() for clean output

Logger Enhancements:

  • Added destination option to createLogger() for custom output streams
  • Added createNullStream() and CapturingStream test helpers for logger testing
  • Added resetLogger() export to reinitialize logger after config changes

Documentation:

  • Updated AGENTS.md with new "Commands for Coding Agents" section
  • Updated testing skill (.claude/skills/testing/SKILL.md) with output silencing patterns and test helpers reference

Cleanup:

  • Removed unused operations/sites module (dead code with unimplemented stubs)

Example Output

Before (verbose):

  WebDavClient
    ✓ creates directory
    ✓ uploads file
    ✓ downloads file
  ... (hundreds of lines)
  
  728 passing (3s)

After (agent-friendly):

  728 passing (3s)

Failure output remains clear:

  728 passing (3s)
  2 failing

  1) test name:
     AssertionError: expected 2 to equal 3
     at Context.<anonymous> (test/file.ts:10:5)

Closes #72

Add test:agent, lint:agent, and typecheck:agent scripts that produce
minimal, machine-readable output optimized for AI coding agents.

Changes:
- Add test:agent scripts using Mocha's min reporter (only failures + summary)
- Add lint:agent scripts using ESLint's --quiet flag
- Add typecheck:agent scripts using tsc --pretty false
- Add runSilent() helper using oclif's captureOutput to suppress command output
- Update stubParse helpers to set log-level: silent by default
- Add global test setup to set SFCC_LOG_LEVEL=silent
- Add logger destination option for custom output streams in tests
- Update tests to use runSilent() for non-JSON mode tests
- Remove unused operations/sites module (dead code)
- Update AGENTS.md with agent-friendly command section
- Update testing skill documentation with output silencing patterns
@clavery
Copy link
Copy Markdown
Collaborator Author

clavery commented Jan 26, 2026

@yhsieh1 if you have time to review this that would be great as this should improve agent usage since it greatly reduces the context used up running tests, etc

@clavery clavery merged commit 70ae3d0 into main Jan 26, 2026
3 checks passed
@clavery clavery deleted the feat/agent-friendly-test-output branch January 26, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Agents instructions for Reduced Context tooling

2 participants